package de.tudarmstadt.ukp.muip.fibqdojo;

import java.util.List;

import de.tudarmstadt.ukp.muip.fibqdojo.interfaces.IFIBQ;
import de.tudarmstadt.ukp.muip.fibqdojo.interfaces.IFIBQDistractor;

/**
 * Default implementation of a FIBQ comprising of a list of strings forming the
 * fibq-questions and a possibibly empty list of distractors.
 * 
 * @author Tobias Horsmann
 */
public class FIBQ implements IFIBQ {

    private final List<String> sentence;
    private final List<IFIBQDistractor> answers;

    public FIBQ(List<String> sentence, List<IFIBQDistractor> distractors) {
        this.sentence = sentence;
        this.answers = distractors;
    }

    @Override
    public String getSentenceAsString(String tokenSeparator) {
        String retVal = "";

        for (int i = 0; i < sentence.size() - 1; i++) {
            retVal += sentence.get(i) + tokenSeparator;
        }
        retVal += sentence.get(sentence.size() - 1);

        return retVal;
    }

    @Override
    public List<String> getSentence() {
        return sentence;
    }

    @Override
    public List<IFIBQDistractor> getDistractors() {
        return answers;
    }

}
